﻿using System;
using System.Collections.Generic;
using System.Linq;
using Moq;
using Ue.CQRS.Events;

namespace Ue.CQRS.Tests
{
    public class Builder
    {
        #region Event

        public static IEvent Event(string eventName)
        {
            var mockEvent = new Mock<IEvent>();

            mockEvent.SetupGet(item => item.Name).Returns(eventName);

            return mockEvent.Object;
        }
        public static IEnumerable<IEvent> Events(params string[] eventNames)
        {
            if (eventNames != null && eventNames.Any())
            {
                foreach (var item in eventNames)
                {
                    yield return Builder.Event(item);
                }
            }
        }

        #endregion
    }
}
